package com.mapper;

import com.javabean.Role;
import com.javabean.RolePermission;
import jdk.internal.org.objectweb.asm.tree.analysis.Value;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface RoleMapper {
    @Select("select * from role")
    List<Role> selectAll();
    @Insert("insert into role(roleName, roleDesc)values(#{roleName},#{roleDesc})")
    int insertRole(Role role);
    @Delete("delete from role where id=#{id}")
    int deleteById(int id);

    Role selectR_P(int id);
    @Update("update role set roleName=#{roleName},roleDesc=#{roleDesc} where id=#{id}")
    int updateRole(Role role);
    @Delete("delete from role_permission where roleId=#{rid}")
    int deleteByRid(int rid);


    int insertR_P(RolePermission rolePermission);
}
